<?php

require '../../config.php';
$_query="SELECT * FROM hossbd.propuestas";
$result = mysql_query($_query,$conexion);  
 
if(mysql_num_rows($result)>0)
{  
			$data = array();
			while ($row = mysql_fetch_array($result))
			 {
			    $data[] = $row['idpropuestas'];
    			$data[] = _convert($row['medio']);
    			$data[] = _convert($row['tipopropuesta']);
    			$data[] = _convert($row['descripcion']);
			}
			echo json_encode($data);		
}
else 
{
	echo("0");
}
function _convert($content) {
	if(!mb_check_encoding($content, 'UTF-8')
	OR !($content === mb_convert_encoding(mb_convert_encoding($content, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) {

		$content = mb_convert_encoding($content, 'UTF-8');

		if (mb_check_encoding($content, 'UTF-8')) {
			// log('Converted to UTF-8');
		} else {
			// log('Could not converted to UTF-8');
		}
	}
	return $content;
}
?> 